package com.yuyou.fn.educational.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.common.util.BigDecimals;
import com.yuyou.fn.common.util.Principals;
import com.yuyou.fn.educational.entity.CourseOrder;
import com.yuyou.fn.educational.vo.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 *
 * CourseOrder 表数据服务层接口
 *
 */
public interface ICourseOrderService extends ISuperService<CourseOrder,Long> {

    Page<CourseOrder> findStudentEffectiveCourseOrderList(Long studentId, int pageNo, int pageSize);

    CourseOrder createOrder(CreateCourseOrderInfo createCourseOrderInfo,Principals.Principal principal ) ;


    void payCourseOrder(CourseOrder courseOrder , PayInfoOfCourseOrder payInfoOfCourseOrder );


    List<CourseOrder> findCourseOrderByParentOrderId(Long parentOrderId);


    /**
     * 线下订单确认
     */
    void confirmPayOrderForOffline(ConfirmPayInfo confirmPayInfo);

    void cancel(Long courseOrderId , Principals.Principal principal);

    CourseOrder createUnOnlineOrder(StudentRegInfoVo studentRegInfoVo ,Principals.Principal principal);

    CourseOrder createOrder(StudentRegInfoVo studentRegInfoVo ,Principals.Principal principal);

    void addCourseOrderDiscount(Long courseOrderId, ApplyDiscountVo applyDiscountVo ) ;


    void delCourseOrderDiscount(Long courseOrderId, Long discountId);

    Map<Long,RegClassDiscountVo> shareDiscountToEachCourseClass(List<DiscountInfoVo> discountInfoList , List<? extends RegClassInfoVo> regClassInfoList);

}